package com.softWang.common.dataPermission.rule.dept;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
public class DeptDataPermissionConfig {
    @Bean
    public DeptDataPermissionRule deptDataPermissionRule(List<DeptDataPermissionRuleCustomizer> customizers) {
        // 创建 DeptDataPermissionRule 对象
        DeptDataPermissionRule rule = new DeptDataPermissionRule();
        // 补全表配置
        if(customizers!= null && !customizers.isEmpty()) {
            customizers.forEach(customizer -> customizer.customize(rule));
        }
        return rule;
    }
}
